#45 new
Jeff Schwab

test_should_delete_token_on_logout fails

Reported by Jeff Schwab | March 18th, 2009 @ 05:18 PM

One of the automatically generated functional test for an authenticated controller fails on Rails 2.3, Ruby 1.9.1. The error message looks like this:

1) Failure: test_should_delete_token_on_logout(SessionsControllerTest) [/Users/jeff/file/proj/guelph/src/test/functional/sessions_controller_test.rb:52]: expected but was <[]>.

The test looks like this:

def test_should_delete_token_on_logout

login_as :quentin
get :destroy
assert_equal @response.cookies["auth_token"], []

end

It passes if assert_equal is replaced with assert_nil:

assert_nil @response.cookies["auth_token"]

I have no idea whether this is the right thing to do. The relevant "cookies" method appears to be the one in ActionController::Cookies#cookies, but there appear to be several layers of indirection beyond that.

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Restful Authentication Generator

This widely-used plugin provides a foundation for securely managing user
authentication:
* Login / logout
* Secure password handling
* Account activation by validating email
* Account approval / disabling by admin
* Rudimentary hooks for authorization and access control.

http://github.com/technoweenie/restful-authentication/tree

People watching this ticket

Pages